/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package proxy;

import java.io.BufferedReader;
import java.io.PrintWriter;
import java.net.Socket;
import thread.Server_Thread;

/**
 *
 * @author Donghui
 */
public class Proxy {

    private static Proxy proxy;
    private BufferedReader in;
    private PrintWriter out;

    public Proxy(){}

    public Proxy(Server_Thread st){
        this.out = st.getSocketModel().getOut();
    }

    public static Proxy getInstance(Server_Thread st) {
        proxy = new Proxy();
        proxy.out = st.getSocketModel().getOut();
        System.out.println(st.getSocketModel().getSocket());
        return proxy;
    }

    public void output(String receive) {
        out.println(receive);
        System.out.println("Sending: " + receive);
        out.flush();
    }
}
